package com.ruoyi.stuactivity.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;

import com.ruoyi.stuactivity.service.IStudentAbilityService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



@RestController
@RequestMapping("/ability")
public class StudentAbilityController extends BaseController {

    @Autowired
    private IStudentAbilityService abilityService;

    /**
     * 获取学生创新思维得分
     */
    @GetMapping("/innovation")
    public AjaxResult getInnovationScore(Authentication authentication) {
        String studentId = authentication.getName();
        System.out.println(studentId);
        double score = abilityService.calculateInnovationScore(studentId);
        System.out.println(score);
        return AjaxResult.success(score);
    }

    @GetMapping("/wenti")
    public AjaxResult getwentiScore(Authentication authentication) {
        String studentId = authentication.getName();
        double wtscore = abilityService.calculatewentiScore(studentId);
        System.out.println(wtscore);
        return AjaxResult.success(wtscore);
    }


    @GetMapping("/jntc")
    public AjaxResult getjntcScore(Authentication authentication) {
        String studentId = authentication.getName();
        double jntcscore = abilityService.calculatejntcScore(studentId);
        System.out.println(jntcscore);
        return AjaxResult.success(jntcscore);
    }

    @GetMapping("/shijian")
    public AjaxResult getshijianScore(Authentication authentication) {
        String studentId = authentication.getName();
        double adjustedScore = abilityService.calculateshijianScore(studentId);
        System.out.println(adjustedScore);
        return AjaxResult.success(adjustedScore);
    }


    @GetMapping("/sixiang")
    public AjaxResult getsixiangScore(Authentication authentication) {
        String studentId = authentication.getName();
        double sixiangscore = abilityService.calculatesixiangScore(studentId);
        System.out.println(sixiangscore);
        return AjaxResult.success(sixiangscore);
    }

    @GetMapping("/zhishi")
    public AjaxResult getzhishiScore(Authentication authentication) {
        String studentId = authentication.getName();
        double zhishiscore = abilityService.calculatezhishiScore(studentId);
        System.out.println(zhishiscore);
        return AjaxResult.success(zhishiscore);
    }
}
